import 'package:flutter/material.dart';
import 'package:search_people/utils/util.dart';

import '../index.dart';

class AnalysisTouchCell extends GetView<AnalysisController> {
  const AnalysisTouchCell({
    Key? key,
    required this.md,
  }) : super(key: key);
  final AnalysisModel md;
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      key: md.key,
      onLongPress: () {
        controller.action3dTouch(md: md);
      },
      child: AnalysisCell(
        md: md,
        onTap: (p0) {},
      ),
    );
  }
}

class AnalysisCell extends StatelessWidget {
  const AnalysisCell({Key? key, required this.md, this.onTap})
      : super(key: key);
  final AnalysisModel md;
  final Function(AnalysisModel)? onTap;
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        if (onTap != null) {
          onTap!(md);
        }
      },
      child: Container(
        margin: EdgeInsets.fromLTRB(12.r, 10.r, 12.r, 0),
        padding: EdgeInsets.symmetric(vertical: 10.r),
        color: Colors.red,
        child: Column(
          children: [
            Text(
              'title--${md.idx}',
              style: TextStyle(color: const Color(0xff333333), fontSize: 16.sp),
            ),
            Text(
              '内容内容内容',
              style: TextStyle(color: const Color(0xff999999), fontSize: 13.sp),
            )
          ],
        ),
      ),
    );
  }
}
